//
//  EFAModel.h
//  efairy
//
//  Created by XiangDongMBP on 2017/7/26.
//  Copyright © 2017年 East. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <YYModel.h>
#import "EFALoginModel.h"
#import "EFADeviceModel.h"
#import "EFAMsgModel.h"
#import "EFAAppModel.h"

@interface EFAModel : NSObject<YYModel, NSCoding>

@property (nonatomic, strong) EFALoginModel *loginInfo;      //!< 用户登录信息(为nil，表明未登录)
@property (nonatomic, strong) EFAProjectModel *projectModel; //!< 项目列表(二级经销商选择项目、报表时用到)
@property (nonatomic, strong) EFADeviceModel *deviceModel;   ///< 设备列表(普通用户才会用到)

+ (instancetype)sharedInstance;
- (BOOL)saveToDisk;
- (BOOL)getFromDisk;

@end


@interface EFAModel (LoginRelative)
@property (nonatomic, readonly) BOOL isNewVersion;  ///< 是否是新版本
@property (nonatomic, readonly) BOOL isLogin;       ///< 是否登录
- (EFALoginModel *)loginModelWithDictionary:(NSDictionary *)dic;
- (void)refreshUserInfoWithDictionary:(NSDictionary *)dic;
- (void)rongCloudOnLine;    //!< 融云IM上线
- (void)bindJPUSHAlias;     ///< 极光推送绑定别名
- (void)CheckJPUSHAlias;    ///< 校验极光推送的别名,如果不成功，再次绑定
- (void)logout;             //!< 退出登录调用的API
@end


#pragma mark - 设备模块
@interface EFAModel (DeviceRelative)
- (EFADeviceModel *)deviceModelWithDictionary:(NSDictionary *)dic;
@end


#pragma mark - 应用模块
@interface EFAModel (AppRelative)
- (EFAProjectModel *)projectModelWithDictionary:(NSDictionary *)dic;
@end

